package com.dayaokeji.rhythmschoolstudent.utils;

import android.graphics.drawable.Drawable;

import com.dayaokeji.rhythmschoolstudent.client.common.base.App;

import es.dmoral.toasty.Toasty;

/**
 * Created by Gorden on 2017/9/23.
 * 封装第三方toast库，方便以后替换
 */

public class ToastUtils {

    public static void info(String message) {
        Toasty.info(App.getAppContext(),message).show();
    }

    public static void normal(String message) {
        Toasty.normal(App.getAppContext(),message).show();
    }

    public static void success(String message) {
        Toasty.success(App.getAppContext(),message).show();
    }

    public static void warning(String message) {
        Toasty.warning(App.getAppContext(),message).show();
    }

    public static void error(String message) {
        Toasty.error(App.getAppContext(),message).show();
    }

    public static void custom(String message, Drawable icon,int duration,boolean withIcon) {
        Toasty.custom(App.getAppContext(),message,icon,duration,withIcon).show();
    }


    public static void info(int msgResId) {
        Toasty.info(App.getAppContext(),App.getAppContext().getString(msgResId)).show();
    }

    public static void normal(int msgResId) {
        Toasty.normal(App.getAppContext(),App.getAppContext().getString(msgResId)).show();
    }

    public static void success(int msgResId) {
        Toasty.success(App.getAppContext(),App.getAppContext().getString(msgResId)).show();
    }

    public static void warning(int msgResId) {
        Toasty.warning(App.getAppContext(),App.getAppContext().getString(msgResId)).show();
    }

    public static void error(int msgResId) {
        Toasty.error(App.getAppContext(),App.getAppContext().getString(msgResId)).show();
    }

    public static void custom(int msgResId, Drawable icon,int duration,boolean withIcon) {
        Toasty.custom(App.getAppContext(),App.getAppContext().getString(msgResId),icon,duration,withIcon).show();
    }
}
